package com.schoolCommunity.mapper;

import com.schoolCommunity.entity.Admin;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author YTH
 * @since 2020-09-21
 */
public interface AdminMapper extends BaseMapper<Admin> {

    //获取所有管理员邮箱，避免重复
    @Select("select email from admin")
    public Set<String> getAllAdminEmailsForSet();

    //获取最后插入的id，不适用高并发
    @Select("SELECT LAST_INSERT_ID()")
    public long GetLastId();

}
